<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCaseOpportunitysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('case_opportunitys', function (Blueprint $table) {
            $table->increments('id');
            $table->string('subject')->default('')->comment('商机标题');
            $table->integer('case_customer_id')->comment('所属客户');
            $table->decimal('expectincome')->default('0')->comment('预期收入');
            $table->date('expectendtime')->comment('预期成交日');
            $table->integer('dealchance')->default('0')->comment('成交几率');
            $table->integer('tempo')->default('1')->comment('机会进度');
            $table->integer('state')->default('1')->comment('状态');
            $table->string('remark')->nullable()->comment('备注');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('case_opportunitys');
    }
}
